import React from 'react'
import { Image } from 'react-vant';
import PropTypes from 'prop-types';
function My_content({listChildren}) {
    return (
        <div>
              {
                listChildren&&listChildren.map((val,ind)=>{
                  return <div key={ind}>
                    <p>{val.title}</p>
                    <Image width="100" height="100" src={val.img} />
                  </div>
                })
              }
        </div>
    )
}

//子组件对父组件传过来的值 进行类型检查
My_content.defaultProps= {
    listChildren:[{
        title:"暂无数据"
    }]
}

My_content.propTypes = {
    listChildren:PropTypes.array.isRequired,
    num:PropTypes.number
}
export default My_content
